<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="../js/vue.js"></script>
    <title></title>
</head>
<body>
    <div id="root">
        姓：<input type="text" v-model="first_name"> <br><br>
        名：<input type="text" v-model="last_name"> <br><br>
        全名：<span>{{first_name.slice(0,3)}} - {{last_name}}</span>
    </div>
    <script type="text/javascript">
        Vue.config.productionTip = false
        const vm = new Vue({
            el: "#root", 
            data:{
                first_name: "张",
                last_name: "三"
            }
        })
    </script>
</body>
</html>